1. Field of the Invention
The present invention relates to a computer-readable recording medium having a communication program recorded thereon, a communication apparatus, and a communication method.
2. Description of the Related Art
Conventionally, there is a communication apparatus provided with a network adapter that receives packets flowing in a network and a network driver that controls operation of the network adapter.
Specifically, when the network adapter first receives packets, it waits during a holding time that is set as a timer parameter. After the lapse of the holding time, the network adapter performs interruption processing sending an interrupt to a communication program provided with the network driver, and thereby notifies the communication program of the packet reception. The communication program receives the packet reception notification from the interrupt processing and temporarily disables interrupt processing of the network adapter, and the network driver performs communication processing of the received packets. The timer parameter is set as a fixed value before the processing starts.
After finishing the packet communication processing, the communication program queries the network adapter whether or not packets have been received during the execution of the interrupt disable processing for the network adapter and the packet communication processing. If the communication program receives a query result from the network adapter indicating that packets have been received, it also performs communication processing of the packets received by the network adapter during the execution of the interrupt disable processing for the network adapter and the packet communication processing. If the communication program receives a query result from the network adapter indicating that no packets have been received, it enables interrupt processing for the network adapter and waits for a packet reception notification from the network adapter.
A problem with the above conventional technique has been that the speed of response to packet reception decreases.
That is, with a large value set as the fixed-value timer parameter, the packet communication processing is started only after the lapse of the holding time according to the timer parameter even when a small number of packets are received per unit time. As a result, a problem with the conventional technique has been that the speed of response to packet reception decreases because of a delay in packet transmission and reception.